@ts-nocheck
<template>
  <el-row :gutter="10">
    <el-col :xs="24" :sm="12" :md="7">
      <el-select style="width: 100%; margin: 6px 0" v-model="formData.selectedSectors" multiple placeholder="请选择扇区模块"
        size="">
        <el-option v-for="item in staticData.sectors" :key="item.value" :label="item.label" :value="item.value">
        </el-option>
      </el-select>
    </el-col>
    <el-col :xs="24" :sm="12" :md="7">
      <el-select style="width: 100%; margin: 6px 0" v-model="formData.selectedModes" placeholder="请选择运行模式" size="">
        <el-option v-for="item in staticData.modes" :key="item.label" :label="item.label" :value="item.value">
        </el-option>
      </el-select>
    </el-col>
    <el-col :xs="18" :sm="12" :md="7">
      <el-checkbox v-model="formData.ignoreInnerTransfer" border size="" style="width: 100%; margin: 6px 0">
        忽略扇区内移交</el-checkbox>
    </el-col>
    <el-col :xs="6" :sm="6" :md="3">
      <el-button type="primary" size="" @click="fetch" style="width: 100%; margin: 6px 0">检索</el-button>
    </el-col>
  </el-row>
</template>

<script>
import staticData from "./staticData.json";
import { mapWritableState } from 'pinia'
import useTransferStore from '@/store/transfer';
export default {
  setup() {
    const transferStore = useTransferStore();
    return {
      transferStore,
    }
  },
  data() {
    return {
      formData: {
        ignoreInnerTransfer: true,
        selectedSectors: [],
        selectedModes: "向北,向北",
      },
      staticData: staticData,
    };
  },
  computed: {
    ...mapWritableState(useTransferStore, {
      filter: 'filter',
      astoredAtiveTab: 'activeTab',
      raw: 'raw',
      card: 'card',
      table: 'table',
    }),
    // transferStore() {
    //   return this.transfer;
    // },
  },
  methods: {
    fetch() {
      if (this.formData.selectedSectors.length == 0) {
        this.$notify.error({
          title: "错误",
          message: "请选择当前扇区所包含的模块",
        });
        return null;
      } else if (this.formData.selectedModes.length == 0) {
        this.$notify.error({
          title: "错误",
          message: "请选择机场当前的运行方向",
        });
        return null;
      } else {
        this.filter = this.formData;
        // this.transferStore.setData({
        //   module: "transfer",
        //   key: "filter",
        //   data: this.formData,
        // });
        this.$emit("fetch");
      }
    },
  },
  created() {
    this.formData = JSON.parse(
      JSON.stringify(this.filter)
    );
    // console.log('transferStore', this.transferStore);
  },
};
</script>

<style scoped>
</style>